package com.zucai365.football.utils;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

	public static Date formatDate( String dateTime ) {
		SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm" );		
		try {
			return dateFormat.parse( dateTime );
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	public static Timestamp formatTimestamp( String dateTime ) {
				
		Date date = DateUtils.formatDate(dateTime);
		return new Timestamp( date.getTime() );
		
	}
}
